import { ref } from 'vue'
export let loopIndex = ref(0)
export let isLoop = ref(true)
let AnimationList: any = null
export const loopAnimationList = (animationList?: any) => {
	if (loopIndex.value == -1) {
		__g.camera.stopAnimation()
		return
	}
	if (!AnimationList) {
		AnimationList = animationList
	}
	if (loopIndex.value >= AnimationList.length || !isLoop.value) {
		loopIndex.value = 0
		isLoop.value = true
	}
	__g.camera.playAnimation(AnimationList[loopIndex.value].id)
	loopIndex.value++
}
